﻿using System;
using System.Collections.Generic;
using Microsoft.EntityFrameworkCore;
using Pomelo.EntityFrameworkCore.MySql.Scaffolding.Internal;

namespace BenCaoXuan.Infrastructure.EFCore.MySql;

public partial class MedicineCenterContext : DbContext
{
    public MedicineCenterContext()
    {
    }

    public MedicineCenterContext(DbContextOptions<MedicineCenterContext> options)
        : base(options)
    {
    }

    public virtual DbSet<Appointment> Appointments { get; set; }

    public virtual DbSet<Arrange> Arranges { get; set; }

    public virtual DbSet<CommissionRule> CommissionRules { get; set; }

    public virtual DbSet<Custom> Customs { get; set; }

    public virtual DbSet<CustomerFollow> CustomerFollows { get; set; }

    public virtual DbSet<CustomerVip> CustomerVips { get; set; }

    public virtual DbSet<CustomerVipCcpsCommission> CustomerVipCcpsCommissions { get; set; }

    public virtual DbSet<CustomerVipCp> CustomerVipCps { get; set; }

    public virtual DbSet<CustomerVipRecord> CustomerVipRecords { get; set; }

    public virtual DbSet<EmployeeRestDay> EmployeeRestDays { get; set; }

    public virtual DbSet<Order> Orders { get; set; }

    public virtual DbSet<OrderDetail> OrderDetails { get; set; }

    public virtual DbSet<OrderPayment> OrderPayments { get; set; }

    public virtual DbSet<Product> Products { get; set; }

    public virtual DbSet<ProductArticle> ProductArticles { get; set; }

    public virtual DbSet<ProductPackage> ProductPackages { get; set; }

    public virtual DbSet<ProductPackageDetail> ProductPackageDetails { get; set; }

    public virtual DbSet<ProductSpec> ProductSpecs { get; set; }

    public virtual DbSet<Room> Rooms { get; set; }

    public virtual DbSet<SysCustomerLoginLog> SysCustomerLoginLogs { get; set; }

    public virtual DbSet<SysDepartment> SysDepartments { get; set; }

    public virtual DbSet<SysDepartmentPostDetail> SysDepartmentPostDetails { get; set; }

    public virtual DbSet<SysDictionary> SysDictionaries { get; set; }

    public virtual DbSet<SysEmployee> SysEmployees { get; set; }

    public virtual DbSet<SysLoginLog> SysLoginLogs { get; set; }

    public virtual DbSet<SysPcLoginLog> SysPcLoginLogs { get; set; }

    public virtual DbSet<SysPost> SysPosts { get; set; }

    public virtual DbSet<SysRight> SysRights { get; set; }

//    protected override void OnConfiguring(DbContextOptionsBuilder optionsBuilder)
//#warning To protect potentially sensitive information in your connection string, you should move it out of source code. You can avoid scaffolding the connection string by using the Name= syntax to read it from configuration - see https://go.microsoft.com/fwlink/?linkid=2131148. For more guidance on storing connection strings, see https://go.microsoft.com/fwlink/?LinkId=723263.
//        => optionsBuilder.UseMySql("server=116.62.217.197;database=medicine_center;uid=root;pwd=xuan20061211YAO20070520@", Microsoft.EntityFrameworkCore.ServerVersion.Parse("8.0.43-mysql"));

    protected override void OnModelCreating(ModelBuilder modelBuilder)
    {
        modelBuilder
            .UseCollation("utf8mb4_0900_ai_ci")
            .HasCharSet("utf8mb4");

        modelBuilder.Entity<Appointment>(entity =>
        {
            entity.HasKey(e => e.AId).HasName("PRIMARY");

            entity.ToTable("Appointment", tb => tb.HasComment("预约表"));

            entity.Property(e => e.AId)
                .HasMaxLength(32)
                .HasComment("预约id")
                .HasColumnName("A_ID");
            entity.Property(e => e.ACustomerId)
                .HasMaxLength(32)
                .HasComment("客户id")
                .HasColumnName("A_CustomerID");
            entity.Property(e => e.ACustomerName)
                .HasMaxLength(32)
                .HasComment("客户姓名")
                .HasColumnName("A_CustomerName");
            entity.Property(e => e.AIsOrder)
                .HasComment("是否转订单")
                .HasColumnName("A_IsOrder");
            entity.Property(e => e.AMoney)
                .HasComment("预约的总价")
                .HasColumnType("double(15,2)")
                .HasColumnName("A_Money");
            entity.Property(e => e.APackageId)
                .HasMaxLength(999)
                .HasComment("选择的套餐id,可以\",\"隔开")
                .HasColumnName("A_PackageID");
            entity.Property(e => e.APeriod)
                .HasComment("预约日期")
                .HasColumnType("datetime")
                .HasColumnName("A_Period");
            entity.Property(e => e.APhone)
                .HasMaxLength(11)
                .HasComment("电话号码")
                .HasColumnName("A_Phone");
            entity.Property(e => e.AProductId)
                .HasMaxLength(999)
                .HasComment("选择的产品规格id,可以\",\"隔开")
                .HasColumnName("A_ProductID");
            entity.Property(e => e.AStatus)
                .HasComment("预约状态,0-已预约 1-已完成 -1已取消")
                .HasColumnName("A_Status");
            entity.Property(e => e.ATime)
                .HasMaxLength(50)
                .HasComment("预约时间")
                .HasColumnName("A_Time");
            entity.Property(e => e.AVisit)
                .HasComment("是否电话访问:0-未访问,1-已访问")
                .HasColumnName("A_Visit");
        });

        modelBuilder.Entity<Arrange>(entity =>
        {
            entity.HasKey(e => e.AId).HasName("PRIMARY");

            entity.ToTable("Arrange", tb => tb.HasComment("排班表"));

            entity.Property(e => e.AId)
                .HasMaxLength(32)
                .HasComment("排班id")
                .HasColumnName("A_ID");
            entity.Property(e => e.ACreateTime)
                .HasComment("创建时间")
                .HasColumnType("datetime")
                .HasColumnName("A_CreateTime");
            entity.Property(e => e.ADate)
                .HasMaxLength(100)
                .HasComment("排班日期")
                .HasColumnName("A_Date");
            entity.Property(e => e.ADesc)
                .HasMaxLength(255)
                .HasComment("备注")
                .HasColumnName("A_Desc");
            entity.Property(e => e.AEid)
                .HasMaxLength(999)
                .HasComment("排班的员工id,用,隔开")
                .HasColumnName("A_EID");
            entity.Property(e => e.ATimeRange)
                .HasMaxLength(100)
                .HasComment("具体排班时间")
                .HasColumnName("A_TimeRange");
            entity.Property(e => e.ATimeSlot)
                .HasMaxLength(100)
                .HasComment("班次类型")
                .HasColumnName("A_TimeSlot");
        });

        modelBuilder.Entity<CommissionRule>(entity =>
        {
            entity.HasKey(e => e.CrId).HasName("PRIMARY");

            entity.ToTable("Commission_Rules", tb => tb.HasComment("佣金规则表"));

            entity.Property(e => e.CrId)
                .HasMaxLength(32)
                .HasComment("佣金规格ID")
                .HasColumnName("CR_id");
            entity.Property(e => e.CrCommissionRate)
                .HasPrecision(10, 2)
                .HasComment("佣金比例")
                .HasColumnName("CR_commission_rate");
            entity.Property(e => e.CrCount)
                .HasComment("购买次数")
                .HasColumnName("CR_count");
            entity.Property(e => e.CrCreateTime)
                .HasDefaultValueSql("CURRENT_TIMESTAMP")
                .HasComment("创建时间")
                .HasColumnType("datetime")
                .HasColumnName("CR_create_time");
            entity.Property(e => e.CrDescription)
                .HasMaxLength(255)
                .HasComment("规则描述")
                .HasColumnName("CR_description");
            entity.Property(e => e.CrPackageId)
                .HasMaxLength(32)
                .HasComment("套餐ID（规则类型为套餐时有效）")
                .HasColumnName("CR_package_id");
            entity.Property(e => e.CrProductId)
                .HasMaxLength(32)
                .HasComment("产品ID（规则类型为服务产品时有效）")
                .HasColumnName("CR_product_id");
            entity.Property(e => e.CrProductName)
                .HasMaxLength(100)
                .HasComment("产品名称")
                .HasColumnName("CR_product_name");
            entity.Property(e => e.CrProductType)
                .HasComment("规则类型（0：服务产品，1：套餐）")
                .HasColumnName("CR_product_type");
        });

        modelBuilder.Entity<Custom>(entity =>
        {
            entity.HasKey(e => e.CId).HasName("PRIMARY");

            entity.ToTable(tb => tb.HasComment("客户表"));

            entity.Property(e => e.CId)
                .HasMaxLength(32)
                .HasComment("客户ID，主键")
                .HasColumnName("C_ID");
            entity.Property(e => e.CCreateTime)
                .HasComment("创建时间")
                .HasColumnType("datetime")
                .HasColumnName("C_CreateTime");
            entity.Property(e => e.CIsConvert)
                .HasComment("是否转换VIP：1-正式客户，0-潜在客户  -1公海客户")
                .HasColumnName("C_IsConvert");
            entity.Property(e => e.CName)
                .HasMaxLength(200)
                .HasComment("客户名称")
                .HasColumnName("C_Name");
            entity.Property(e => e.CPassword)
                .HasMaxLength(32)
                .HasComment("密码")
                .HasColumnName("C_Password");
            entity.Property(e => e.CPhone)
                .HasMaxLength(11)
                .HasComment("联系电话")
                .HasColumnName("C_Phone");
            entity.Property(e => e.CRemark)
                .HasMaxLength(500)
                .HasComment("客户备注信息")
                .HasColumnName("C_Remark");
            entity.Property(e => e.CResource)
                .HasMaxLength(32)
                .HasComment("客户来源：广告 介绍 自行上门 关联字典表")
                .HasColumnName("C_Resource");
            entity.Property(e => e.CSalt)
                .HasMaxLength(32)
                .HasComment("盐")
                .HasColumnName("C_Salt");
            entity.Property(e => e.CStatus)
                .HasComment("跟进状态 0-跟进中 1-已完成 2-待跟进")
                .HasColumnName("C_Status");
            entity.Property(e => e.CUpdateTime)
                .HasComment("更新时间")
                .HasColumnType("datetime")
                .HasColumnName("C_UpdateTime");
        });

        modelBuilder.Entity<CustomerFollow>(entity =>
        {
            entity.HasKey(e => e.CfId).HasName("PRIMARY");

            entity.ToTable("Customer_Follow", tb => tb.HasComment("客户跟进记录表"));

            entity.HasIndex(e => e.CfCustomerId, "IDX_CF_CustomerID");

            entity.HasIndex(e => e.CfEmployeeId, "IDX_CF_EmployeeID");

            entity.Property(e => e.CfId)
                .HasMaxLength(32)
                .HasComment("跟进记录ID，主键")
                .HasColumnName("CF_ID");
            entity.Property(e => e.CfCreateTime)
                .HasComment("记录创建时间")
                .HasColumnType("datetime")
                .HasColumnName("CF_CreateTime");
            entity.Property(e => e.CfCustomerId)
                .HasMaxLength(32)
                .HasComment("客户ID，关联客户表")
                .HasColumnName("CF_CustomerID");
            entity.Property(e => e.CfEmployeeId)
                .HasMaxLength(32)
                .HasComment("跟进人ID，关联员工表")
                .HasColumnName("CF_EmployeeID");
            entity.Property(e => e.CfFollowContent)
                .HasComment("跟进内容详情")
                .HasColumnType("text")
                .HasColumnName("CF_FollowContent");
            entity.Property(e => e.CfFollowType)
                .HasMaxLength(32)
                .HasComment("跟进类型 关联字典表")
                .HasColumnName("CF_FollowType");
            entity.Property(e => e.CfNextTime)
                .HasComment("下次跟进记录")
                .HasColumnType("datetime")
                .HasColumnName("CF_NextTime");
            entity.Property(e => e.CfRemark)
                .HasMaxLength(500)
                .HasComment("跟进备注信息")
                .HasColumnName("CF_Remark");
            entity.Property(e => e.CfResult)
                .HasComment("跟进结果：1-有意向，2-无意向")
                .HasColumnName("CF_Result");
            entity.Property(e => e.CfUpdateTime)
                .HasComment("记录更新时间")
                .HasColumnType("datetime")
                .HasColumnName("CF_UpdateTime");
        });

        modelBuilder.Entity<CustomerVip>(entity =>
        {
            entity.HasKey(e => e.CvId).HasName("PRIMARY");

            entity.ToTable("Customer_Vip", tb => tb.HasComment("客户VIP表"));

            entity.HasIndex(e => e.CvExpireTime, "IDX_CV_ExpireTime");

            entity.HasIndex(e => e.CvStatus, "IDX_CV_Status");

            entity.HasIndex(e => e.CvCustomerId, "UK_CV_CustomerID").IsUnique();

            entity.HasIndex(e => e.CvVipcode, "UK_CV_VIPCode").IsUnique();

            entity.Property(e => e.CvId)
                .HasMaxLength(32)
                .HasComment("VIP记录ID，主键")
                .HasColumnName("CV_ID");
            entity.Property(e => e.CvCreateTime)
                .HasComment("记录创建时间")
                .HasColumnType("datetime")
                .HasColumnName("CV_CreateTime");
            entity.Property(e => e.CvCustomerId)
                .HasMaxLength(32)
                .HasComment("客户ID，关联客户表（唯一）")
                .HasColumnName("CV_CustomerID");
            entity.Property(e => e.CvExpireTime)
                .HasComment("VIP到期时间（NULL表示永久）")
                .HasColumnType("datetime")
                .HasColumnName("CV_ExpireTime");
            entity.Property(e => e.CvGetTime)
                .HasComment("成为VIP的时间")
                .HasColumnType("datetime")
                .HasColumnName("CV_GetTime");
            entity.Property(e => e.CvOperatorId)
                .HasMaxLength(32)
                .HasComment("操作员ID，关联员工表")
                .HasColumnName("CV_OperatorID");
            entity.Property(e => e.CvPoint)
                .HasPrecision(15, 2)
                .HasDefaultValueSql("'0.00'")
                .HasComment("当前VIP积分")
                .HasColumnName("CV_Point");
            entity.Property(e => e.CvRemark)
                .HasMaxLength(500)
                .HasComment("VIP备注信息")
                .HasColumnName("CV_Remark");
            entity.Property(e => e.CvStatus)
                .HasComment("VIP状态：1-正常，2-冻结，3-过期")
                .HasColumnName("CV_Status");
            entity.Property(e => e.CvVipcode)
                .HasMaxLength(50)
                .HasComment("VIP会员编号（唯一）")
                .HasColumnName("CV_VIPCode");
        });

        modelBuilder.Entity<CustomerVipCcpsCommission>(entity =>
        {
            entity.HasKey(e => e.CcvcId).HasName("PRIMARY");

            entity.ToTable("Customer_Vip_Ccps_Commission", tb => tb.HasComment("VIP客户推广佣金记录表（CCPS）"));

            entity.Property(e => e.CcvcId)
                .HasMaxLength(32)
                .HasComment("佣金记录ID，主键")
                .HasColumnName("CCVC_id");
            entity.Property(e => e.CcvcBaseAmount)
                .HasPrecision(10, 2)
                .HasComment("计算基数金额：如被邀请人消费金额、VIP开通费用")
                .HasColumnName("CCVC_base_amount");
            entity.Property(e => e.CcvcCancelReason)
                .HasMaxLength(512)
                .HasComment("取消原因（状态为\"已取消\"时填写）")
                .HasColumnName("CCVC_cancel_reason");
            entity.Property(e => e.CcvcCommissionAmount)
                .HasPrecision(10, 2)
                .HasComment("佣金金额（元）")
                .HasColumnName("CCVC_commission_amount");
            entity.Property(e => e.CcvcCommissionRate)
                .HasPrecision(5, 2)
                .HasComment("佣金比例（%）：如消费金额的5%")
                .HasColumnName("CCVC_commission_rate");
            entity.Property(e => e.CcvcCommissionStatus)
                .HasComment("佣金状态：1-待发放，2-已发放")
                .HasColumnName("CCVC_commission_status");
            entity.Property(e => e.CcvcCps)
                .HasMaxLength(999)
                .HasComment("推广链接")
                .HasColumnName("CCVC_cps");
            entity.Property(e => e.CcvcCreateTime)
                .HasComment("记录创建时间（佣金触发时间）")
                .HasColumnType("datetime")
                .HasColumnName("CCVC_create_time");
            entity.Property(e => e.CcvcFreezeReason)
                .HasMaxLength(512)
                .HasComment("冻结原因（状态为\"已冻结\"时填写）")
                .HasColumnName("CCVC_freeze_reason");
            entity.Property(e => e.CcvcInviteeId)
                .HasMaxLength(32)
                .HasComment("被邀请人ID（新客户），关联客户表")
                .HasColumnName("CCVC_invitee_id");
            entity.Property(e => e.CcvcOperatorId)
                .HasMaxLength(32)
                .HasComment("操作人ID：如发放/取消的操作员，关联员工表（系统操作填\"sys\"）")
                .HasColumnName("CCVC_operator_id");
            entity.Property(e => e.CcvcPromoterId)
                .HasMaxLength(32)
                .HasComment("推广人ID（VIP客户），关联客户表")
                .HasColumnName("CCVC_promoter_id");
            entity.Property(e => e.CcvcReleaseTime)
                .HasComment("佣金发放时间（状态为\"已发放\"时必填）")
                .HasColumnType("datetime")
                .HasColumnName("CCVC_release_time");
            entity.Property(e => e.CcvcRemark)
                .HasMaxLength(512)
                .HasComment("备注：如\"2024Q3邀请活动佣金\"")
                .HasColumnName("CCVC_remark");
            entity.Property(e => e.CcvcTriggerNo)
                .HasMaxLength(64)
                .HasComment("触发业务单号：如消费订单号、VIP开通单号")
                .HasColumnName("CCVC_trigger_no");
            entity.Property(e => e.CcvcTriggerType)
                .HasComment("佣金触发类型：1-被邀请人注册，2-被邀请人消费，3-被邀请人升级VIP")
                .HasColumnName("CCVC_trigger_type");
            entity.Property(e => e.CcvcUpdateTime)
                .HasComment("记录更新时间（状态变更时间）")
                .HasColumnType("datetime")
                .HasColumnName("CCVC_update_time");
        });

        modelBuilder.Entity<CustomerVipCp>(entity =>
        {
            entity.HasKey(e => e.CvcId).HasName("PRIMARY");

            entity.ToTable("Customer_Vip_Cps", tb => tb.HasComment("VIP客户推广链接表（CPS）"));

            entity.HasIndex(e => e.CvcCustomerId, "IDX_CVC_CustomerID");

            entity.HasIndex(e => e.CvcStatus, "IDX_CVC_Status");

            entity.HasIndex(e => e.CvcVipid, "IDX_CVC_VIPID");

            entity.HasIndex(e => e.CvcValidEndTime, "IDX_CVC_ValidEndTime");

            entity.HasIndex(e => e.CvcCpsCode, "UK_CVC_CpsCode").IsUnique();

            entity.Property(e => e.CvcId)
                .HasMaxLength(32)
                .HasComment("推广链接ID，主键")
                .HasColumnName("CVC_ID");
            entity.Property(e => e.CvcCpsCode)
                .HasMaxLength(100)
                .HasComment("推广唯一标识（短码/邀请码）")
                .HasColumnName("CVC_CpsCode");
            entity.Property(e => e.CvcCpsLink)
                .HasComment("完整推广链接（含参数）")
                .HasColumnType("text")
                .HasColumnName("CVC_CpsLink");
            entity.Property(e => e.CvcCreateTime)
                .HasComment("链接创建时间")
                .HasColumnType("datetime")
                .HasColumnName("CVC_CreateTime");
            entity.Property(e => e.CvcCustomerId)
                .HasMaxLength(32)
                .HasComment("VIP客户ID，关联客户表（推广人）")
                .HasColumnName("CVC_CustomerID");
            entity.Property(e => e.CvcIsPointsGiven)
                .HasComment("注册客户第一次消费是否加分")
                .HasColumnName("CVC_IsPointsGiven");
            entity.Property(e => e.CvcMaxUseCount)
                .HasDefaultValueSql("'0'")
                .HasComment("链接最大使用次数（0表示无限制）")
                .HasColumnName("CVC_MaxUseCount");
            entity.Property(e => e.CvcRegisterId)
                .HasMaxLength(32)
                .HasComment("推广后，注册客户ID，关联VIP客户")
                .HasColumnName("CVC_RegisterID");
            entity.Property(e => e.CvcRemark)
                .HasMaxLength(500)
                .HasComment("推广备注：如\"2024年Q3好友邀请活动链接\"")
                .HasColumnName("CVC_Remark");
            entity.Property(e => e.CvcRewardCondition)
                .HasMaxLength(200)
                .HasComment("奖励条件：如\"被邀请人注册并成为VIP\"")
                .HasColumnName("CVC_RewardCondition");
            entity.Property(e => e.CvcRewardType)
                .HasComment("奖励类型：1-积分奖励，2-成长值奖励，3-现金返利")
                .HasColumnName("CVC_RewardType");
            entity.Property(e => e.CvcRewardValue)
                .HasPrecision(15, 2)
                .HasDefaultValueSql("'0.00'")
                .HasComment("奖励数值（积分/成长值填整数，现金填小数）")
                .HasColumnName("CVC_RewardValue");
            entity.Property(e => e.CvcStatus)
                .HasDefaultValueSql("'1'")
                .HasComment("链接状态：1-正常，2-已禁用，3-已过期")
                .HasColumnName("CVC_Status");
            entity.Property(e => e.CvcUpdateTime)
                .HasComment("链接更新时间")
                .HasColumnType("datetime")
                .HasColumnName("CVC_UpdateTime");
            entity.Property(e => e.CvcUsedCount)
                .HasDefaultValueSql("'0'")
                .HasComment("链接已使用次数（被成功邀请人数）")
                .HasColumnName("CVC_UsedCount");
            entity.Property(e => e.CvcValidEndTime)
                .HasComment("链接失效时间（NULL表示永久有效）")
                .HasColumnType("datetime")
                .HasColumnName("CVC_ValidEndTime");
            entity.Property(e => e.CvcValidStartTime)
                .HasComment("链接生效开始时间")
                .HasColumnType("datetime")
                .HasColumnName("CVC_ValidStartTime");
            entity.Property(e => e.CvcVipid)
                .HasMaxLength(32)
                .HasComment("VIP记录ID，关联客户VIP表")
                .HasColumnName("CVC_VIPID");
        });

        modelBuilder.Entity<CustomerVipRecord>(entity =>
        {
            entity.HasKey(e => e.CvrId).HasName("PRIMARY");

            entity.ToTable("Customer_Vip_Record", tb => tb.HasComment("客户VIP行为记录表"));

            entity.Property(e => e.CvrId)
                .HasMaxLength(32)
                .HasComment("VIP行为记录ID，主键")
                .HasColumnName("CVR_ID");
            entity.Property(e => e.CvrCreateTime)
                .HasComment("行为发生时间")
                .HasColumnType("datetime")
                .HasColumnName("CVR_CreateTime");
            entity.Property(e => e.CvrCustomerId)
                .HasMaxLength(32)
                .HasComment("客户ID，关联客户表")
                .HasColumnName("CVR_CustomerID");
            entity.Property(e => e.CvrMoney)
                .HasPrecision(15, 2)
                .HasDefaultValueSql("'0.00'")
                .HasComment("金额（元）：充值/消费金额，非金额类行为填0")
                .HasColumnName("CVR_Money");
            entity.Property(e => e.CvrOperatorId)
                .HasMaxLength(32)
                .HasComment("操作人ID，关联员工表（系统操作填固定标识如\"sys\"）")
                .HasColumnName("CVR_OperatorID");
            entity.Property(e => e.CvrRecordType)
                .HasComment("行为类型：1-充值，2-消费，3-积分兑换，4-积分赠送，5-成长值增加，6-成长值扣减,关联字典表")
                .HasColumnName("CVR_RecordType");
            entity.Property(e => e.CvrRemark)
                .HasMaxLength(500)
                .HasComment("行为备注：如\"充值赠100积分\"、\"购买产品消费\"")
                .HasColumnName("CVR_Remark");
            entity.Property(e => e.CvrVipid)
                .HasMaxLength(32)
                .HasComment("VIP记录ID，关联客户VIP表")
                .HasColumnName("CVR_VIPID");
        });

        modelBuilder.Entity<EmployeeRestDay>(entity =>
        {
            entity.HasKey(e => e.ErId).HasName("PRIMARY");

            entity.ToTable("Employee_RestDay", tb => tb.HasComment("员工休息表"));

            entity.Property(e => e.ErId)
                .HasMaxLength(32)
                .HasComment("休息id")
                .HasColumnName("ER_ID");
            entity.Property(e => e.ErCreateTime)
                .HasDefaultValueSql("CURRENT_TIMESTAMP")
                .HasColumnType("datetime")
                .HasColumnName("ER_CreateTime");
            entity.Property(e => e.ErEid)
                .HasMaxLength(32)
                .HasComment("员工id")
                .HasColumnName("ER_Eid");
            entity.Property(e => e.ErRestDay)
                .HasComment("休息天,0-6代表周一到周日")
                .HasColumnName("ER_RestDay");
        });

        modelBuilder.Entity<Order>(entity =>
        {
            entity.HasKey(e => e.OId).HasName("PRIMARY");

            entity.ToTable("Order", tb => tb.HasComment("订单表"));

            entity.Property(e => e.OId)
                .HasMaxLength(32)
                .HasComment("订单ID，主键")
                .HasColumnName("O_ID");
            entity.Property(e => e.OCompleteTime)
                .HasComment("订单完成时间")
                .HasColumnType("datetime")
                .HasColumnName("O_CompleteTime");
            entity.Property(e => e.OCreateTime)
                .HasComment("创建时间")
                .HasColumnType("datetime")
                .HasColumnName("O_CreateTime");
            entity.Property(e => e.OCustomerId)
                .HasMaxLength(32)
                .HasComment("客户ID，关联客户表")
                .HasColumnName("O_CustomerID")
                .UseCollation("ucs2_general_ci")
                .HasCharSet("ucs2");
            entity.Property(e => e.OCustomerName)
                .HasMaxLength(32)
                .HasComment("客户名称")
                .HasColumnName("O_CustomerName");
            entity.Property(e => e.OCustomerPhone)
                .HasMaxLength(11)
                .HasComment("客户电话")
                .HasColumnName("O_CustomerPhone");
            entity.Property(e => e.OEmployeeArtId)
                .HasMaxLength(32)
                .HasComment("理疗师id")
                .HasColumnName("O_EmployeeArtID");
            entity.Property(e => e.OEmployeeFrontId)
                .HasMaxLength(32)
                .HasComment("前台操作人员id")
                .HasColumnName("O_EmployeeFrontID");
            entity.Property(e => e.OIsAppointment)
                .HasComment("是否是预约转订单,0-否1-是")
                .HasColumnName("O_IsAppointment");
            entity.Property(e => e.OOrderStatus)
                .HasComment("订单状态：0-进行中，1-已完成")
                .HasColumnName("O_OrderStatus");
            entity.Property(e => e.OPayStatus)
                .HasComment("支付状态：0-待支付，1-已支付")
                .HasColumnName("O_PayStatus");
            entity.Property(e => e.OPayType)
                .HasMaxLength(32)
                .HasComment("支付方式：关联字典表的支付类型id")
                .HasColumnName("O_PayType");
            entity.Property(e => e.ORoomId)
                .HasMaxLength(32)
                .HasComment("房间id")
                .HasColumnName("O_RoomID");
            entity.Property(e => e.OTotalAmount)
                .HasPrecision(15, 2)
                .HasComment("订单总金额")
                .HasColumnName("O_TotalAmount");
        });

        modelBuilder.Entity<OrderDetail>(entity =>
        {
            entity.HasKey(e => e.OdId).HasName("PRIMARY");

            entity.ToTable("Order_Details", tb => tb.HasComment("订单明细表"));

            entity.HasIndex(e => e.OdOrderId, "IDX_OD_OrderID");

            entity.HasIndex(e => e.OdProductId, "IDX_OD_ProductID");

            entity.Property(e => e.OdId)
                .HasMaxLength(32)
                .HasComment("订单明细ID，主键")
                .HasColumnName("OD_ID");
            entity.Property(e => e.OdOrderId)
                .HasMaxLength(32)
                .HasComment("订单ID,关联订单表")
                .HasColumnName("OD_OrderID");
            entity.Property(e => e.OdPackageId)
                .HasMaxLength(666)
                .HasComment("套餐id,逗号隔开")
                .HasColumnName("OD_PackageID");
            entity.Property(e => e.OdProductId)
                .HasMaxLength(666)
                .HasComment("产品规格id,逗号隔开")
                .HasColumnName("OD_ProductID");
        });

        modelBuilder.Entity<OrderPayment>(entity =>
        {
            entity.HasKey(e => e.OpId).HasName("PRIMARY");

            entity.ToTable("Order_Payment", tb => tb.HasComment("订单支付记录表"));

            entity.Property(e => e.OpId)
                .HasMaxLength(32)
                .HasComment("订单支付记录ID，主键")
                .HasColumnName("OP_ID");
            entity.Property(e => e.OpCreateTime)
                .HasComment("创建时间")
                .HasColumnType("datetime")
                .HasColumnName("OP_CreateTime");
            entity.Property(e => e.OpMoney)
                .HasComment("支付金额")
                .HasColumnName("OP_Money");
            entity.Property(e => e.OpOid)
                .HasMaxLength(32)
                .HasComment("订单id")
                .HasColumnName("OP_OID");
        });

        modelBuilder.Entity<Product>(entity =>
        {
            entity.HasKey(e => e.PId).HasName("PRIMARY");

            entity.ToTable("Product", tb => tb.HasComment("产品表"));

            entity.Property(e => e.PId)
                .HasMaxLength(32)
                .HasComment("产品ID，主键")
                .HasColumnName("P_ID");
            entity.Property(e => e.PCover)
                .HasMaxLength(100)
                .HasComment("产品封面")
                .HasColumnName("P_Cover");
            entity.Property(e => e.PCreateTime)
                .HasComment("创建时间")
                .HasColumnType("datetime")
                .HasColumnName("P_CreateTime");
            entity.Property(e => e.PDescription)
                .HasMaxLength(999)
                .HasComment("产品描述")
                .HasColumnName("P_Description");
            entity.Property(e => e.PIsBan)
                .HasComment("是否禁用：1-禁用，0-启用")
                .HasColumnName("P_IsBan");
            entity.Property(e => e.PIsGroup)
                .HasComment("是否是套餐 1-是,0-不是")
                .HasColumnName("P_IsGroup");
            entity.Property(e => e.PName)
                .HasMaxLength(200)
                .HasComment("产品名称")
                .HasColumnName("P_Name");
            entity.Property(e => e.PPhoto)
                .HasComment("产品图片(多张,隔开,轮播图)")
                .HasColumnType("text")
                .HasColumnName("P_Photo");
            entity.Property(e => e.PProductAttention)
                .HasMaxLength(999)
                .HasComment("产品注意事项")
                .HasColumnName("P_ProductAttention");
            entity.Property(e => e.PProductEffect)
                .HasMaxLength(999)
                .HasComment("产品功效")
                .HasColumnName("P_ProductEffect");
            entity.Property(e => e.PRemark)
                .HasMaxLength(500)
                .HasComment("产品备注信息")
                .HasColumnName("P_Remark");
            entity.Property(e => e.PRules)
                .HasPrecision(10, 2)
                .HasComment("产品佣金比例")
                .HasColumnName("P_Rules");
            entity.Property(e => e.PTypeId)
                .HasMaxLength(32)
                .HasComment("产品类型ID")
                .HasColumnName("P_TypeID");
            entity.Property(e => e.PUpdateTime)
                .HasComment("更新时间")
                .HasColumnType("datetime")
                .HasColumnName("P_UpdateTime");
        });

        modelBuilder.Entity<ProductArticle>(entity =>
        {
            entity.HasKey(e => e.PaId).HasName("PRIMARY");

            entity.ToTable("Product_Article", tb => tb.HasComment("产品文章表"));

            entity.HasIndex(e => e.PaProductType, "idx_category");

            entity.HasIndex(e => e.PaStatus, "idx_status");

            entity.Property(e => e.PaId)
                .HasMaxLength(32)
                .HasComment("文章ID")
                .HasColumnName("PA_ID");
            entity.Property(e => e.PaContent)
                .HasComment("文章内容")
                .HasColumnType("text")
                .HasColumnName("PA_Content");
            entity.Property(e => e.PaCover)
                .HasMaxLength(255)
                .HasComment("文章封面")
                .HasColumnName("PA_Cover");
            entity.Property(e => e.PaCreateTime)
                .HasComment("创建时间")
                .HasColumnType("datetime")
                .HasColumnName("PA_CreateTime");
            entity.Property(e => e.PaLookCount)
                .HasComment("浏览量")
                .HasColumnName("PA_LookCount");
            entity.Property(e => e.PaProductId)
                .HasMaxLength(32)
                .HasComment("产品id")
                .HasColumnName("PA_ProductID");
            entity.Property(e => e.PaProductName)
                .HasMaxLength(255)
                .HasComment("产品名称")
                .HasColumnName("PA_ProductName");
            entity.Property(e => e.PaProductType)
                .HasMaxLength(100)
                .HasComment("类别")
                .HasColumnName("PA_ProductType");
            entity.Property(e => e.PaPublishTime)
                .HasComment("发布日期")
                .HasColumnType("datetime")
                .HasColumnName("PA_PublishTime");
            entity.Property(e => e.PaStatus)
                .HasComment("状态(1-已发布 0-草稿)")
                .HasColumnName("PA_Status");
            entity.Property(e => e.PaTitle)
                .HasMaxLength(255)
                .HasComment("文章标题")
                .HasColumnName("PA_Title");
        });

        modelBuilder.Entity<ProductPackage>(entity =>
        {
            entity.HasKey(e => e.PpId).HasName("PRIMARY");

            entity.ToTable("Product_Package", tb => tb.HasComment("产品套装表"));

            entity.Property(e => e.PpId)
                .HasMaxLength(32)
                .HasComment("套餐ID，主键")
                .HasColumnName("PP_ID");
            entity.Property(e => e.PpCreateTime)
                .HasComment("创建时间")
                .HasColumnType("datetime")
                .HasColumnName("PP_CreateTime");
            entity.Property(e => e.PpDescription)
                .HasComment("套餐简介")
                .HasColumnType("text")
                .HasColumnName("PP_Description");
            entity.Property(e => e.PpDuration)
                .HasMaxLength(50)
                .HasComment("套餐总时长（分钟）")
                .HasColumnName("PP_Duration");
            entity.Property(e => e.PpEndTime)
                .HasComment("结束时间")
                .HasColumnType("datetime")
                .HasColumnName("PP_EndTime");
            entity.Property(e => e.PpIsBan)
                .HasComment("是否禁用：1-禁用，0-启用")
                .HasColumnName("PP_IsBan");
            entity.Property(e => e.PpName)
                .HasMaxLength(200)
                .HasComment("套餐名称")
                .HasColumnName("PP_Name");
            entity.Property(e => e.PpOriginalPrice)
                .HasPrecision(10, 2)
                .HasComment("套餐原价")
                .HasColumnName("PP_OriginalPrice");
            entity.Property(e => e.PpPhoto)
                .HasMaxLength(100)
                .HasComment("套餐封面")
                .HasColumnName("PP_Photo");
            entity.Property(e => e.PpPrice)
                .HasPrecision(10, 2)
                .HasComment("套餐售价")
                .HasColumnName("PP_Price");
            entity.Property(e => e.PpRemark)
                .HasMaxLength(500)
                .HasComment("套餐备注信息")
                .HasColumnName("PP_Remark");
            entity.Property(e => e.PpRules)
                .HasPrecision(10, 2)
                .HasComment("套餐佣金")
                .HasColumnName("PP_Rules");
            entity.Property(e => e.PpStartTime)
                .HasComment("套餐开始时间")
                .HasColumnType("datetime")
                .HasColumnName("PP_StartTime");
            entity.Property(e => e.PpStatus)
                .HasComment("套餐状态：1-在售，2-下架，3-预售")
                .HasColumnName("PP_Status");
            entity.Property(e => e.PpUpdateTime)
                .HasComment("更新时间")
                .HasColumnType("datetime")
                .HasColumnName("PP_UpdateTime");
        });

        modelBuilder.Entity<ProductPackageDetail>(entity =>
        {
            entity.HasKey(e => e.PpdId).HasName("PRIMARY");

            entity.ToTable("Product_Package_Details", tb => tb.HasComment("产品套装明细表"));

            entity.HasIndex(e => e.PpdPackageId, "IDX_PPD_PackageID");

            entity.HasIndex(e => e.PpdProductId, "IDX_PPD_ProductID");

            entity.Property(e => e.PpdId)
                .HasMaxLength(32)
                .HasComment("....")
                .HasColumnName("PPD_ID");
            entity.Property(e => e.PpdCreateTime)
                .HasComment("创建时间")
                .HasColumnType("datetime")
                .HasColumnName("PPD_CreateTime");
            entity.Property(e => e.PpdPackageId)
                .HasMaxLength(32)
                .HasComment("套装ID，关联产品套装表")
                .HasColumnName("PPD_PackageID");
            entity.Property(e => e.PpdProductId)
                .HasMaxLength(32)
                .HasComment("产品ID，关联产品表")
                .HasColumnName("PPD_ProductID");
            entity.Property(e => e.PpdProductSpecsId)
                .HasMaxLength(32)
                .HasComment("规格ID,关联规格表")
                .HasColumnName("PPD_ProductSpecsID");
            entity.Property(e => e.PpdProductSpecsName)
                .HasMaxLength(255)
                .HasComment("产品的规格名称")
                .HasColumnName("PPD_ProductSpecsName");
            entity.Property(e => e.PpdRemark)
                .HasMaxLength(500)
                .HasComment("明细备注信息")
                .HasColumnName("PPD_Remark");
            entity.Property(e => e.PpdSinglePrice)
                .HasPrecision(10, 2)
                .HasComment("单个产品在套装中的定价")
                .HasColumnName("PPD_SinglePrice");
            entity.Property(e => e.PpdSort)
                .HasComment("明细排序")
                .HasColumnName("PPD_Sort");
        });

        modelBuilder.Entity<ProductSpec>(entity =>
        {
            entity.HasKey(e => e.PsId).HasName("PRIMARY");

            entity.ToTable("Product_Specs", tb => tb.HasComment("产品规格表"));

            entity.Property(e => e.PsId)
                .HasMaxLength(32)
                .HasComment("规格ID，主键")
                .HasColumnName("PS_ID");
            entity.Property(e => e.PsCreateTime)
                .HasComment("创建时间")
                .HasColumnType("datetime")
                .HasColumnName("PS_CreateTime");
            entity.Property(e => e.PsIsBan)
                .HasComment("是否禁用：1-禁用，0-启用")
                .HasColumnName("PS_IsBan");
            entity.Property(e => e.PsName)
                .HasMaxLength(100)
                .HasComment("规格名称（如颜色、尺寸等）")
                .HasColumnName("PS_Name");
            entity.Property(e => e.PsPrice)
                .HasComment("该规格的售价")
                .HasColumnType("double(10,2)")
                .HasColumnName("PS_Price");
            entity.Property(e => e.PsProductId)
                .HasMaxLength(32)
                .HasComment("产品ID，关联产品表")
                .HasColumnName("PS_ProductID");
            entity.Property(e => e.PsRemark)
                .HasMaxLength(500)
                .HasComment("规格备注信息")
                .HasColumnName("PS_Remark");
            entity.Property(e => e.PsSort)
                .HasComment("规格排序")
                .HasColumnName("PS_Sort");
            entity.Property(e => e.PsUpdateTime)
                .HasComment("更新时间")
                .HasColumnType("datetime")
                .HasColumnName("PS_UpdateTime");
        });

        modelBuilder.Entity<Room>(entity =>
        {
            entity.HasKey(e => e.RId).HasName("PRIMARY");

            entity.ToTable("Room", tb => tb.HasComment("房间信息表"));

            entity.Property(e => e.RId)
                .HasMaxLength(32)
                .HasComment("房间ID")
                .HasColumnName("R_Id");
            entity.Property(e => e.RCreateTime)
                .HasDefaultValueSql("CURRENT_TIMESTAMP")
                .HasComment("创建时间")
                .HasColumnType("datetime")
                .HasColumnName("R_CreateTime");
            entity.Property(e => e.RCurrentOccupancy)
                .HasDefaultValueSql("'0'")
                .HasComment("当前入住人数")
                .HasColumnName("R_CurrentOccupancy");
            entity.Property(e => e.RIsBan)
                .HasComment("是否禁用")
                .HasColumnName("R_IsBan");
            entity.Property(e => e.RName)
                .HasMaxLength(100)
                .HasComment("房间名称")
                .HasColumnName("R_Name");
            entity.Property(e => e.RStatus)
                .HasDefaultValueSql("'0'")
                .HasComment("房间状态：0-未满，1-已满")
                .HasColumnName("R_Status");
            entity.Property(e => e.RTotalBeds)
                .HasDefaultValueSql("'1'")
                .HasComment("总床位数")
                .HasColumnName("R_TotalBeds");
            entity.Property(e => e.RUpdateTime)
                .ValueGeneratedOnAddOrUpdate()
                .HasDefaultValueSql("CURRENT_TIMESTAMP")
                .HasComment("更新时间")
                .HasColumnType("datetime")
                .HasColumnName("R_UpdateTime");
        });

        modelBuilder.Entity<SysCustomerLoginLog>(entity =>
        {
            entity.HasKey(e => e.LlId).HasName("PRIMARY");

            entity.ToTable("Sys_CustomerLogin_Log", tb => tb.HasComment("客户移动端登录日志表"));

            entity.Property(e => e.LlId)
                .HasMaxLength(32)
                .HasComment("日志ID，主键")
                .HasColumnName("LL_ID");
            entity.Property(e => e.LlCid)
                .HasMaxLength(32)
                .HasComment("用户ID，关联客户表")
                .HasColumnName("LL_CID");
            entity.Property(e => e.LlCname)
                .HasMaxLength(50)
                .HasComment("登录用户名")
                .HasColumnName("LL_CName");
            entity.Property(e => e.LlCode)
                .HasMaxLength(32)
                .HasComment("凭据")
                .HasColumnName("LL_Code");
            entity.Property(e => e.LlIpaddress)
                .HasMaxLength(50)
                .HasComment("登录IP地址")
                .HasColumnName("LL_IPAddress");
            entity.Property(e => e.LlLoginTime)
                .HasComment("登录时间")
                .HasColumnType("datetime")
                .HasColumnName("LL_LoginTime");
            entity.Property(e => e.LlRemark)
                .HasMaxLength(500)
                .HasComment("备注信息")
                .HasColumnName("LL_Remark");
        });

        modelBuilder.Entity<SysDepartment>(entity =>
        {
            entity.HasKey(e => e.DId).HasName("PRIMARY");

            entity.ToTable("Sys_Department", tb => tb.HasComment("部门表"));

            entity.Property(e => e.DId)
                .HasMaxLength(32)
                .HasComment("部门ID，主键")
                .HasColumnName("D_ID");
            entity.Property(e => e.DCreateTime)
                .HasComment("创建时间")
                .HasColumnType("datetime")
                .HasColumnName("D_CreateTime");
            entity.Property(e => e.DIcon)
                .HasMaxLength(255)
                .HasComment("部门图标")
                .HasColumnName("D_Icon");
            entity.Property(e => e.DIsBan)
                .HasComment("部门状态：1-禁用，0-启用")
                .HasColumnName("D_IsBan");
            entity.Property(e => e.DLv)
                .HasMaxLength(255)
                .HasComment("父级等级(高级,中级,低级)")
                .HasColumnName("D_Lv");
            entity.Property(e => e.DName)
                .HasMaxLength(100)
                .HasComment("部门名称")
                .HasColumnName("D_Name");
            entity.Property(e => e.DParentId)
                .HasMaxLength(32)
                .HasComment("父部门ID，用于构建部门层级")
                .HasColumnName("D_ParentID");
            entity.Property(e => e.DRemark)
                .HasMaxLength(500)
                .HasComment("部门备注信息")
                .HasColumnName("D_Remark");
        });

        modelBuilder.Entity<SysDepartmentPostDetail>(entity =>
        {
            entity.HasKey(e => e.DpId).HasName("PRIMARY");

            entity.ToTable("Sys_DepartmentPost_Details", tb => tb.HasComment("部门岗位关联表"));

            entity.Property(e => e.DpId)
                .HasMaxLength(32)
                .HasComment("关联id")
                .HasColumnName("DP_ID");
            entity.Property(e => e.DpCreateTime)
                .HasComment("创建时间")
                .HasColumnType("datetime")
                .HasColumnName("DP_CreateTime");
            entity.Property(e => e.DpDid)
                .HasMaxLength(32)
                .HasComment("部门id,关联部门表")
                .HasColumnName("DP_DID");
            entity.Property(e => e.DpPid)
                .HasMaxLength(32)
                .HasComment("部门下的岗位id,关联岗位id")
                .HasColumnName("DP_PID");
        });

        modelBuilder.Entity<SysDictionary>(entity =>
        {
            entity.HasKey(e => e.DId).HasName("PRIMARY");

            entity.ToTable("Sys_Dictionary", tb => tb.HasComment("字典表"));

            entity.Property(e => e.DId)
                .HasMaxLength(32)
                .HasComment("字典ID，主键")
                .HasColumnName("D_ID");
            entity.Property(e => e.DCreateTime)
                .HasComment("创建时间")
                .HasColumnType("datetime")
                .HasColumnName("D_CreateTime");
            entity.Property(e => e.DIcon)
                .HasMaxLength(100)
                .HasComment("图标")
                .HasColumnName("D_Icon");
            entity.Property(e => e.DIsBan)
                .HasComment("状态：1-禁用，0-启用")
                .HasColumnName("D_IsBan");
            entity.Property(e => e.DIsType)
                .HasComment("是否是类型 0-否 1-是")
                .HasColumnName("D_IsType");
            entity.Property(e => e.DName)
                .HasMaxLength(100)
                .HasComment("字典名称")
                .HasColumnName("D_Name");
            entity.Property(e => e.DParentId)
                .HasMaxLength(32)
                .HasComment("父字典ID，用于多级字典")
                .HasColumnName("D_ParentID");
            entity.Property(e => e.DRemark)
                .HasMaxLength(500)
                .HasComment("字典备注信息")
                .HasColumnName("D_Remark");
            entity.Property(e => e.DSort)
                .HasComment("排序序号")
                .HasColumnName("D_Sort");
        });

        modelBuilder.Entity<SysEmployee>(entity =>
        {
            entity.HasKey(e => e.EId).HasName("PRIMARY");

            entity.ToTable("Sys_Employees", tb => tb.HasComment("员工表"));

            entity.HasIndex(e => e.EAccount, "E_Account").IsUnique();

            entity.Property(e => e.EId)
                .HasMaxLength(32)
                .HasComment("员工ID，主键")
                .HasColumnName("E_ID");
            entity.Property(e => e.EAccount)
                .HasMaxLength(11)
                .HasComment("登录账号=联系电话")
                .HasColumnName("E_Account");
            entity.Property(e => e.EAddress)
                .HasMaxLength(200)
                .HasComment("地址")
                .HasColumnName("E_Address");
            entity.Property(e => e.ECreateTime)
                .HasComment("创建时间")
                .HasColumnType("datetime")
                .HasColumnName("E_CreateTime");
            entity.Property(e => e.EDepartmentId)
                .HasMaxLength(32)
                .HasComment("所属部门ID，关联部门表")
                .HasColumnName("E_DepartmentID");
            entity.Property(e => e.EGender)
                .HasComment("性别,0-女 1-男")
                .HasColumnName("E_Gender");
            entity.Property(e => e.EIsBan)
                .HasComment("账号状态：1-禁用，0-启用")
                .HasColumnName("E_IsBan");
            entity.Property(e => e.ELeisure)
                .HasComment("是否空闲:0-空闲,1-相反")
                .HasColumnName("E_Leisure");
            entity.Property(e => e.EName)
                .HasMaxLength(50)
                .HasComment("员工姓名")
                .HasColumnName("E_Name");
            entity.Property(e => e.EPassword)
                .HasMaxLength(100)
                .HasComment("登录密码")
                .HasColumnName("E_Password");
            entity.Property(e => e.EPhone)
                .HasMaxLength(11)
                .HasComment("联系电话")
                .HasColumnName("E_Phone");
            entity.Property(e => e.EPhoto)
                .HasMaxLength(100)
                .HasComment("员工头像")
                .HasColumnName("E_Photo");
            entity.Property(e => e.EPostId)
                .HasMaxLength(32)
                .HasComment("所属岗位ID，关联岗位表")
                .HasColumnName("E_PostID");
            entity.Property(e => e.ERemark)
                .HasMaxLength(500)
                .HasComment("员工备注信息")
                .HasColumnName("E_Remark");
            entity.Property(e => e.ESalt)
                .HasMaxLength(32)
                .HasComment("盐")
                .HasColumnName("E_Salt");
            entity.Property(e => e.ESpecialties)
                .HasMaxLength(999)
                .HasComment("擅长领域,用,隔开")
                .HasColumnName("E_Specialties");
            entity.Property(e => e.EStatus)
                .HasComment("员工状态：1-在职，2-离职，3-休假")
                .HasColumnName("E_Status");
        });

        modelBuilder.Entity<SysLoginLog>(entity =>
        {
            entity.HasKey(e => e.LlId).HasName("PRIMARY");

            entity.ToTable("Sys_Login_Log", tb => tb.HasComment("系统登录日志表"));

            entity.Property(e => e.LlId)
                .HasMaxLength(32)
                .HasComment("日志ID，主键")
                .HasColumnName("LL_ID");
            entity.Property(e => e.LlCode)
                .HasMaxLength(32)
                .HasComment("凭据")
                .HasColumnName("LL_Code");
            entity.Property(e => e.LlEid)
                .HasMaxLength(32)
                .HasComment("用户ID，关联员工表")
                .HasColumnName("LL_EID");
            entity.Property(e => e.LlEname)
                .HasMaxLength(50)
                .HasComment("登录用户名")
                .HasColumnName("LL_EName");
            entity.Property(e => e.LlIpaddress)
                .HasMaxLength(50)
                .HasComment("登录IP地址")
                .HasColumnName("LL_IPAddress");
            entity.Property(e => e.LlLoginTime)
                .HasComment("登录时间")
                .HasColumnType("datetime")
                .HasColumnName("LL_LoginTime");
            entity.Property(e => e.LlRemark)
                .HasMaxLength(500)
                .HasComment("备注信息")
                .HasColumnName("LL_Remark");
        });

        modelBuilder.Entity<SysPcLoginLog>(entity =>
        {
            entity.HasKey(e => e.LlId).HasName("PRIMARY");

            entity.ToTable("Sys_PcLogin_Log", tb => tb.HasComment("桌面端登录日志表"));

            entity.Property(e => e.LlId)
                .HasMaxLength(32)
                .HasComment("日志ID，主键")
                .HasColumnName("LL_ID");
            entity.Property(e => e.LlCode)
                .HasMaxLength(32)
                .HasComment("凭据")
                .HasColumnName("LL_Code");
            entity.Property(e => e.LlEid)
                .HasMaxLength(32)
                .HasComment("用户ID，关联员工表(前台员工)")
                .HasColumnName("LL_EID");
            entity.Property(e => e.LlEname)
                .HasMaxLength(50)
                .HasComment("登录用户名")
                .HasColumnName("LL_EName");
            entity.Property(e => e.LlIpaddress)
                .HasMaxLength(50)
                .HasComment("登录IP地址")
                .HasColumnName("LL_IPAddress");
            entity.Property(e => e.LlLoginTime)
                .HasComment("登录时间")
                .HasColumnType("datetime")
                .HasColumnName("LL_LoginTime");
            entity.Property(e => e.LlRemark)
                .HasMaxLength(500)
                .HasComment("备注信息")
                .HasColumnName("LL_Remark");
        });

        modelBuilder.Entity<SysPost>(entity =>
        {
            entity.HasKey(e => e.PId).HasName("PRIMARY");

            entity.ToTable("Sys_Post", tb => tb.HasComment("岗位表"));

            entity.Property(e => e.PId)
                .HasMaxLength(32)
                .HasComment("岗位ID，主键")
                .HasColumnName("P_ID");
            entity.Property(e => e.PCreateTime)
                .HasComment("创建时间")
                .HasColumnType("datetime")
                .HasColumnName("P_CreateTime");
            entity.Property(e => e.PIsBan)
                .HasComment("岗位状态：1-禁用，0-启用")
                .HasColumnName("P_IsBan");
            entity.Property(e => e.PLv)
                .HasMaxLength(255)
                .HasComment("岗位等级")
                .HasColumnName("P_Lv");
            entity.Property(e => e.PName)
                .HasMaxLength(100)
                .HasComment("岗位名称")
                .HasColumnName("P_Name");
            entity.Property(e => e.PRemark)
                .HasMaxLength(500)
                .HasComment("岗位备注信息")
                .HasColumnName("P_Remark");
            entity.Property(e => e.PResponsibility)
                .HasMaxLength(999)
                .HasComment("岗位职责")
                .HasColumnName("P_Responsibility");
        });

        modelBuilder.Entity<SysRight>(entity =>
        {
            entity.HasKey(e => e.RId).HasName("PRIMARY");

            entity.ToTable("Sys_Right", tb => tb.HasComment("权限表"));

            entity.Property(e => e.RId)
                .HasMaxLength(32)
                .HasColumnName("R_ID");
            entity.Property(e => e.RCreateTime)
                .HasComment("添加时间")
                .HasColumnType("datetime")
                .HasColumnName("R_CreateTime");
            entity.Property(e => e.RDesc)
                .HasMaxLength(255)
                .HasComment("描述")
                .HasColumnName("R_Desc");
            entity.Property(e => e.RIcon)
                .HasMaxLength(100)
                .HasComment("权限图标")
                .HasColumnName("R_Icon");
            entity.Property(e => e.RIsBan)
                .HasComment("是否禁用")
                .HasColumnName("R_IsBan");
            entity.Property(e => e.RIsMenu)
                .HasComment("是否是菜单")
                .HasColumnName("R_IsMenu");
            entity.Property(e => e.RName)
                .HasMaxLength(99)
                .HasComment("权限名称")
                .HasColumnName("R_Name");
            entity.Property(e => e.RNo)
                .HasComment("序号")
                .HasColumnName("R_No");
            entity.Property(e => e.RParent)
                .HasMaxLength(32)
                .HasComment("上级权限")
                .HasColumnName("R_Parent");
            entity.Property(e => e.RUrl)
                .HasMaxLength(99)
                .HasComment("权限地址")
                .HasColumnName("R_Url");
        });

        OnModelCreatingPartial(modelBuilder);
    }

    partial void OnModelCreatingPartial(ModelBuilder modelBuilder);
}
